answer "No match for keyword " "e& holder"e
pop card
end if
hide msg
end if
click at 0,0 --disable selection
end mouseUp
On MouseWithin -- UNSOM technique by Guy Kuo, December 13, 1987
-- handles option-click to create new reference
if the OptionKey is down then
if the locktext of the target is true then
put true into DidUnlock
set locktext of target to false
else
put false into DidUnlock
end if
set the cursor to 2
repeat while (the OptionKey is down) and (item 1 of the rect of target <= item 1 of the mouseLoc) and (item 1 of the mouseLoc <= item 3 of the rect of target) and (item 2 of the rect of target <= item 2 of the mouseLoc) and (item 2 of the mouseLoc <= item 4 of the rect of target)
if the Mouse is down then
click at the MouseLoc
click at the ClickLoc
if the selection <> empty then
-- this is XrefText code
put the selection into holder
type holder & "*"
push card
find holder in field keywords
if the result is not empty then
doMenu New Card
put holder into field keywords
set the name of this card to holder
get the number of lines in card field finder of card theIndex
put holder into line it+1 of card field finder of card theIndex
else
put the length of holder into hl
put the length of word 1 of field keywords into kl
if hl<>kl then
answer "Close match but not exact!" with "Good Enough" or "New Card"
if it contains "New" then
set lockscreen to true
go prev
doMenu New Card
put holder into field keywords
set the name of this card to holder
get the number of lines in card field finder of card theIndex
put holder into line it+1 of card field finder of card theIndex
set lockscreen to false
end if
end if
end if
end if
if field body is empty then
type tab
else
click at -1,-1
end if
end if
end repeat
if DidUnlock then
set the locktext of the target to true
end if
end if
end MouseWithin
-- part 2 (field)
-- low flags: 01
-- high flags: 2004
-- rect: left=36 top=33 right=58 bottom=269
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: keywords
----- HyperTalk script -----
on mouseUp
set cursor to 4
put field keywords into holder
put the number of this card into num
put empty into field inlinks
put "One moment, Please." into line 2 of field inlinks
show field inlinkstitle
show field inlinks
show bkgnd button "Hide"
put "What links to " & holder &"?" into field inlinkstitle
put the number of cards into counter
set lockscreen to true
put empty into field inlinks
repeat counter
go next
if field body contains holder then
put return after last line of field inlinks of card num
put field keywords after last line of field inlinks of card num
end if
end repeat
play harpsichord
flash 1
show field inlinkstitle
show field inlinks
show bkgnd button "Hide"
set lockscreen to false
click at 0,0 --disable selection
set lockText of the target to true
end mouseUp
-- part 12 (button)
-- low flags: 80
-- high flags: 8004
-- rect: left=355 top=72 right=98 bottom=384
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: OK
----- HyperTalk script -----
on mouseUp
hide bkgnd button OK
show field body
end mouseUp
-- part 40 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=412 top=316 right=341 bottom=495
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: DeleteCard
----- HyperTalk script -----
on mouseUp
if the number of this card >1 then
answer "OK to delete this card?" with "OK" or "Cancel"
if it = "OK" then
doMenu Delete Card
go card theIndex
click at the loc of button "Re-Index"
end if
else
play boing
answer "Uh-uh. You don't want to delete this card."
end if
end mouseUp
-- part 41 (field)
-- low flags: 81
-- high flags: 2002
-- rect: left=258 top=32 right=52 bottom=426
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: inlinkstitle
-- part 42 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=258 top=51 right=114 bottom=426
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: inlinks
----- HyperTalk script -----
on mouseUp
if the selection is empty then
set lockText of the target to false
put item 1 of the rect of field inlinks into leftend
put item 3 of the rect of field inlinks into rightend
put item 2 of the clickloc into vert
click at leftend+2,vert
click at rightend-25,vert with shiftkey
put the selection into holder
push card
visual effect wipe right to black
visual effect wipe left
find holder in field keywords -- This line is the link
if the result is not empty then
answer "No match for keyword " "e& holder"e